import 'package:flutter/cupertino.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Widget/MyInput.dart';

class Discount extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
        margin: EdgeInsets.only(top: 100),
        child: Column(children: [
          Input("現金", "元"),
          Input("折扣", "折"),
        ]));
  }
}

class Input extends StatelessWidget {
  String title;
  String unit;

  Input(this.title, this.unit);

  @override
  Widget build(BuildContext context) {
    return Container(
        margin: EdgeInsets.only(top: 20),
        child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
          Text(title, style: TextStyle(fontSize: 20, color: MyColor.C70)),
          Container(
              width: 203,
              height: 40,
              margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
              padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
              decoration: Global.getWhiteBg(20),
              child: Row(children: [
                Expanded(child: NormalInput(inputType: NormalInput.Number, customReg: NormalInput.mathReg)),
                Text(unit, style: TextStyle(fontSize: 20, color: MyColor.C70)),
              ]))
        ]));
  }
}
